package com.xiaol.business.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 *  @Controller
 *      处理http请求，一般用于返回模版，参考IndexController里的例子
 *  @RestController
 *      返回Json，相当与Controller与ResponseBody两个注解的组合
 *  @RequestMapping
 *      映射URL的 @RequestMapping(value="/hello", method = RequestMethod.GET)
 *      value：写多个，用数组扩起来
 *      method：不写，默认都可以访问
 *  @GetMapping
 *      组合注解，等于RequestMapping里设置method = RequestMethod.GET
 */
@RestController
public class HelloController {

    @RequestMapping(value="/hello", method = RequestMethod.GET)
    public String say(){
        return "Hello Xiaol";
    }
}
